
import os
import numpy
import random
import cv2

'''
height = 200
width = 200

for fileNames in os.listdir('./training_set'):
    path = './training_set/' + fileNames
    img = cv2.imread(path)
    img = cv2.resize(img, (height, width))
    cv2.imwrite(path[0:-3] + 'jpg', img)
    
'''
img_none = cv2.imread('1.jpg', 0)
print(img_none.shape)


a = 400
b = 600
for i in range(6000):
    x = random.randint(0, a)
    y = random.randint(0, b)
    print('({},{})'.format(x,y))
    res = img_none[x : x + 200, y : y + 200]
    cv2.imwrite('./training_set/' + str(i) + '.jpg', res)